fix bug with nested lists