edited error handling in signup and login ($error = NULL)