Adds beforeFail and beforeComplete hooks on jobs