protect against bad input
Merge pull request #32 from mharrys/error-input

protect against bad input