fix bug (create figure directory if necessary)