fixed stats NullPointerException bug