fixing errors with sed matching