Fix for appendHtml not using the index.