fixed task sorting bug