added error controller