Use an overcast stitch to prevent fraying.