implemented login/logout functionallity