fixed error writing pdf from admin