fixed error checking with user registration