On get reference changed the use of empty with hasReference