fixed problem caused by logging in without logging out