Added errorscontroller for handling errors