Bug fix

If statement condition was wrong. Fixed.