fixed if-statement error