Add write method