remove left-behind generated file
switch to using Control.Exception.catch