fix NULL-Pointer bug