fixed some null pointers