failed to declare iterator properly