Application of callback functions in modaless dialog