fixing error catch.
Merge pull request #401 from joseym/master

fixing thrown error