add write method to test