added support for passport error handling