added logout method. Untested though