don't assume document.head exists (e.g. IE8)