Provide proper var to if statement