Check that callback exists before calling it