error handling on logout