fix for incorrect handling of logout