adding error checks
Merge pull request #1 from IndianHillsLawrence/master

adding error checks