Fix a bug about calling callback