added some more error handling
Merge pull request #410 from Atheros1/master

added some more error handling