added qthread for communication. not ready yet.