add validation
some tweaks
Merge pull request #14 from 1000ch/master

add validation