fixing callback gets called twice if throws exception