Am I Wrong?

So I kinda told a little white lie to my boyfriend. I am friends with one of my ex's. We are completely platonic. My boyfriend didn't know about it until he saw me texting him. He asked who it was and why I never told him about him. I lied and said he was a distant cousin. I ONLY lied because I didn't feel like arguing with him. He said the text messages looked flirty and I knew he wouldn't think anything if I told him he was my cousin. Well today while I was showering he looked through my phone and saw us talking about how we used to date and he's pissed at me. I know lying is bad but I only lied to avoid fighting with him.