almost implemented the user authentication functionality