solve "sending message to a Handler on a dead thread" problem