fix write protection bug when fork