Adding some check to avoid errors
Fix typo and change check to prettiest way
Merge pull request #1 from enovance/add_check

Adding some check to avoid errors