fixed a few null pointers