some nullpointer error fixed