fix a bug null pointer