null-reference fix