fixed a crash when clearing an empty list