fixed a bug in after hook processing with failed authentications