Correct variable value check functionality