fixed if-statements