Adding error handler to step 7