fixed some sort issues