[18] a delicate solution, does not handle many possible error conditions