Added in replaceNotes() function to ajaxScript to fix notes