add user authentication and register function for different users