Getting error “fields have different lengths”