add centralized error controller