handle errors a little better in invoke* methods.