fixed reference errors