implemented login and registration