added unsafe cow mechnisem
made copy-on-write work