added some callbacks for debugging