add write tests