updating modal dialog to function as service