Use the correct acid and reagent
To test a fresh portion of a solution for halide ions, first add dilute nitric acid, then add silver nitrate solution. Acidification removes interference from carbonate ions that could also give a precipitate. Use nitric acid, not hydrochloric acid: hydrochloric acid contains chloride ions and could introduce the very ion being tested for. Reagents must therefore be chosen as carefully as observations are interpreted.