write and release method