Needs a var: 'var count = ...' or just put that right into the if statement