added some login/logout logic