add close after write/read event
fix read empty data error