added login and logout code