fixing the damn null pointers