Roof cracks

I am preparing my'74 Scamp for paint. On both the drivers and passenger side there are cracks behind the rear quarter windows. I picked out some of the filler that was in one of the cracks and put some primer in it. the other side is untouched. Is there a proper way to repair this so that it doesn't crack after my paint job??