adding write/read debug messages