bugfix for thread unsharing