Added new authorization logic