Add optional min and max ids