thread safe all lib code + copy policy fix