Give Them Time

I had a boyfreind i was with for 7months, he cheated on me after a while with my best freind he said sorry ect and i forgave him and then bout 2months later he dumps me for her.. what did i do? basically dont let your bf be alone with your mates, if he cheats on you with a freind get rid of them straight away!!