implemented login logout functionality