Implemented refresh and logout