found the bug that causes crashes in map-building, the indices steps out of bound