Fixed indexing with AJAX insertion