added error handling to save patch popup