generalized the info_dialog function