fixed bug where the error is not rescued