added some code that will allow for a reregistration thread I think