implemented logout functionality for the doctor