Added functionality for logout, still need unit tests for it