fix variable parsing bug