Fix nasty error on logout

Would make this a pull request, but i cant figure out how xD