finished user registration function