Fix raise condition on logout