fixed a minor typo (issues -> issued) and added a check that the updated instance isn't null to avoid a NPE accessing foo.id if the params data causes a validation error