fix nullpointer error