Fixed bug with authorizing