Feeding Problem

I have flat nipples and I use nipple shield (medium) for feeding!! My 4weeks old always sucks on edge of the nipple and it hurts real bad!! I tried so many different positions to feed him.. But always he ends up sucking at the edge which is really painful!! I started pumping milk and feeding him by bottle to avoid pain.. 😒 What am I doing wrong!!?