             send success: true, msg: "Register succeeds."
 
     createUser = () ->
-        hash = cryptPassword password
+        hash = utils.cryptPassword password
 
         user = new User
             email: email

        else
            changeUserData users[0]


            data.email = newEmail

        if newPassword? and newPassword.length > 0
            data.password = utils.cryptPassword newPassword
        
        user.updateAttributes data, (err) ->
            if err
