fixes propagation of errors in "After" hooks