writing user registration code