Updating javascript for exporting