Forgot a condition in JS