Add document element as target
Rewrite the script