Fix small issue

Variable check must be done with special functions. Otherwise there is a chance to get an error.