Fix bug with authorization