make working logout logic