The prob is not yours, the prob is in your bf! He got tempted.
But you know what girl, we can't do anything to forbin them to look and talk to other girl cuz they're just human too, and they longing for someone to talk with, if you are not around to talk to him, ofcourse he will find attention from others. Boys are always be boys! It's sad but that's the truth!