modified sed command to work with BSD sed (so it works on a mac)