Fix empty collection issue