Added logic to update trials that had already been imported