Fix small issue

Variable check must be done with special functions. Otherwise there is a chance to get an error.
Merge pull request #2 from ArtemProkopenko/patch-1

Fix small issue