fix bug in stat