fixed if statement with flipped > comparison