added active login/logout function