fix empty list bugs