implemented login functionality