fix null references