slightly reimplented again to have a seperate XbeeTread rather than using Xbee as the thread