Safe ajax and changed AssocArray to sortedEach function.