fixed if statement errors