remove lock in stat
various changes