fix sed issue between gnu and bsd versions