fix bug: error global vars