fix variable references