fixed the if statement from commit 58f2399