added reregistration (doesn't work yet due to unpacking error
added reregistration, without locks
merged with master