Fix if-statement