made some changes to Thread Client - when checking if incoming is empty, peeking first is sufficient, changed pop to remove first as we are using a queue and not a stack