fix variable definition bug