insertBefore fix