making sure we check !buffer if documentHTML is an object