fixed a bug

null pointers, who knew