function getStats() revised
part of bug #1067