Masturbation is lesser "evil" because it will let the poison out and shut down biological compulsion rather then seeking gratification by making yourself "different" and "unwholesome" towards women. Guys do dumb stuff when feel stirred up, going to chats, talking and provoking girls and then blame themselves for their behavior, that thing between legs can really make you problems you going to regret.
so if you feel you losing control just let poison out so you can be more sane. And just try to develop wisdom of seeing the body the way it is, to see this body as pus, bones, muscles, worms inside, small crawling things eating your skin, bacterias. It's only hormones who paint this bag of meat as desirable, if you have clear vision no human is desirable, generally we are all ugly no matter how much followers you have on instagram, if you look at your body sincerity and investigate it properly then desire naturally will fall off, but be aware if you start doing this investigation you will find libido sky rocketing like not ever before. sometimes I think nature knows what you are doing and will try to put down your cultivation and let you think "okay, let's go with normal life..." but do not give up.