Auto erasing of old messages in order to prevent the LocalStorage to be depleted (variable threshold)