Fix empty list bug