fixed reference to invalid variable