added user registration function