cancel task when any exception occurs