correct casting of if inline