replaced sed with inverse grep for updating preferences