fix index scan bug