Add check for callback function