added try/catch around editing