fixed sed flags for BSD compatability