fix for nullpointer error where outgoingreferences can be null.