Fix to be able to take an optional onCancelCallback