compensates for lag in AJAX when passing sort array to Angular, which was causing duplicate errors