fix variable not found bug