modify hook for failures