fixed some null references