implement stats locking
add stuff for testing again