Add error handling around .encrypt