fixed bug with logout, and access permission