fix a bug in fig2pdf that close the figure then try to set properties