Fixed empty task appearing after sorting bug