updated logout callback function