added login and logut mechanism