added oncancel handling to the sourcedialog