Fixing "not logged in " problem