Add error management in mtsearch