add --backup flag and attempt to address various exceptions that may be raised