nullref error fix