       return callback new KodingError \
         'A valid machineId and an update option is required.', 'WrongParameter'
 
-    return  unless isValid { ipAddress, queryString, storage }, callback
+    if err = isValid { ipAddress, queryString, storage }
+      return callback err
 
     fieldsToUpdate = {}
 

KONFIG            = require('koding-config-manager').load("main.#{argv.c}")


isValid = ({ ipAddress, queryString, storage }, callback) ->

  if ipAddress? and (ipAddress.split '.').length isnt 4
    callback new KodingError 'Provided IP is not valid', 'WrongParameter'
    return no

  if queryString? and (queryString.split '/').length isnt 8
    callback new KodingError 'Provided queryString is not valid', 'WrongParameter'
    return no

  if storage? and isNaN +storage
    callback new KodingError 'Provided storage is not valid', 'WrongParameter'
    return no

  return yes

getKiteIdOnly = (queryString) ->
  "///////#{queryString.split('/').reverse()[0]}"

    { label, queryString, ipAddress } = options
    { r: { group, user, account } } = client

    if err = isValid { queryString, ipAddress }
      return callback err

    queryString = getKiteIdOnly queryString
    provider    = @providerSlug
