resolve bug nullpointer apos a thread