fixed 2 reference errors