Make sure callback gets called on an error