fixed bug on empty lists