fix for invalid index type