fixed login and logout buttons and added helper methods