Fix sorting and change accordion to close before opening next module