Fixed bug with authorization