fix bug figure reading