must insert at correct index