Team damage when I'm not even shooting in their direction

Whenver another player is close to me, say about 4 feet or more, but not in front of me, and I'm shooting at the enemy, I fire once and get 2 team attack damage. Happens quite often.So much so that I often get damage charged back at me and I die.It's not that I dont accidently shoot teammates, but when I'm not, and they're not in front of me, why should I get charged with team damage when I didn't shoot them.