Check stats object to be null to avoid NPE