fix variable ref