added error checking for editing a quiz