Brought  edit up to date with error routine