fix problem with no tail after last nest