changes to unauthorized handling