correct potential null ref