[1037446] Fixed document.head is undefined for addNewRule