When you feel you can't control your urge anymore, go outside, take a deep breath, and then call a person you love, or your friend, your mentor, your guide, anybody. Have a normal conversation, don't talk about porn and masturbation if you don't want to. Have a friendly chat for some time. Feels great, and the urge is gone. Even after that, if the urge still persists, go ahead and relapse. But I'm sure the urge won't persist. Try it.