Fix duplicated if condition.