chapter 5: io handler