Fixed out of range insert error