Sorting AJAX for updating user details