avoid potential over index bug.