added capture message functions to testing program.