ensure callback exists before calling apply