sort so the script doesn't submit data multiple times