added additional error trapping
Merge pull request #242 from ajstanley/6.x

added additional error trapping