Fixing bug with replacing preferences