Updates toJSON method if stats are undefined