Which machine, and does the middle fill in pretty quickly?
The oft seen practice of tapping the tamped portafilter with the tamper can lead to perimeter channel. Also be light when locking the portafilter into the group head, it doesn't take much to lose that seal around the edge.
You can also try moving the tamper to north edge of the basket and tamping, then east, tamp, south and west. If your basket is tapered, you can try dosing less or tamping harder until the tamper does get stopped by the outer walls.