fix condition an if statement range