solution to logout issue