fix a bug when iterate locations