Trying to fix a bug for sed