check for write errors
use range value