added sorting the list of packages because php is not good at this apparently