add handler chain code to io