Adding some error handling in the copyNotes() method