Fix for authentication state check