rewrite stat_update_master_callback, fix #41