added functionality for logging out