Fixes logout 'access denied' error