fix vector iterator bug