fix issue with empty lists