added additional handler to task result for handling both success and failure