fix threefold repetition