fix exception capture