added modal dialog for errors