debugged extensively using mock IOHandler object