Added session write_close