Fix null ref

Fix potential null ref