fix mixed if closures causing error.