changes in write method
changes in write method