fix nullpoint exception