updated user registration logic