handles case of empty list