fixed logging in and out