improve js for pdf modal box