fixed reference issues