fixed bug with authorization