add loading indicator functionality for loading stats