class sorting fix