add write-mode
add assertion