Fixed bug with user registration