Added log in and log out logic