Update to js to only apply for document