fix null error if element defs not exist.