fix on nullPointer bug