fix the empty list bug