Gross... Anal sex accident

Guys this is gross but I need advice. My boyfriend and I regularly have sex but every once in a while we like to do anal. Until... A few months ago he pulled out to switch positions during anal and there was poo... Everywhere! That had never happened before and it was so embarassing I refuse to do it again even though I enjoy it
Any tips on how to NEVER LET THAT HAPPEN AGAIN??!!! Most embarrassing thing ever 😭