fixed envelope to support optional callback