fixing authorization bug