fixed bug in sorting topics