Added authorization logic