Fix if statement for 2.4