Handle data in thread.