implemented logic for raising failure event