fix doc
protect recursive write_to
add `freeze` and `is_frozen`
add new_sub