Added a check for edit session before trying to roll back when run_scripts fails