added functionality for user registration