fix bug: null pointer exception.