Fixing logout issues