added input validation
Merge pull request #57 from idleberg/2.0-dev

added input validation