Fixed authorization check