fix variable override bug