fixed a bug for a callback function