Fix duplicated if