fixed error variable references