fixed up error handeling
Merge pull request #3 from MauriceButler/master

fixed up error handeling