added function for logout, but is not working at the moment.