added modal dialog code