script runs at document_end