fix bug: null pointer problem