Changed how access denied handler works.