Added code and view for logout