introducing errorHandler middleware