fixing sorting problem in classes page