add security error handler