Fix crash when the block callback is invoked