Fix bug returns null when get reference