fix api to keep nice stack traces