check for a callback before calling it