fix insertBefore and target.length (empty select boxes failed)