better error catching
Merge pull request #10 from craigspaeth/master

better error catching