Missed stupid 'i' in if statement