add condition !=null to avoid crash on compilation for DCNS