passing the surface to the dialog