Fixed accidental running of code multiple times on the same trail (array was not deduplicated)