Validate existence of callback function before calling it