logout working properly