fixed minor bug on enumerate