update flag to boolean on search