Fixed typo in JS if statement conditional