Fix authorization bug