fix potential null pointer