Added authorization handling