Fixed authorization bug