fix figures bugs