fix nullref