Adding some error handling
Merge pull request #2 from zmalone/master

Adding some error handling