add write method