the callback function re-designed