Added storage of the callback and threshold.