Updated AddReferences

Added a check to see if the reference has already been added.