fix figure saving