Small fix for if statement