add input checks
add security checks
Merge pull request #1 from aknosis/master

Added some input and security checks