added definition of  withfailurehandling