# Problem inserting keys in association list

**URL:** <https://swi-prolog.discourse.group/t/problem-inserting-keys-in-association-list/1055>\
**Category:** Help!\
**Created:** [August 11, 2019, 10:20am UTC](https://swi-prolog.discourse.group/t/problem-inserting-keys-in-association-list/1055 "2019-08-11T10:20:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![topgun11](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@topgun11](https://swi-prolog.discourse.group/u/topgun11)\
**Post date:** [August 11, 2019, 10:20am UTC](https://swi-prolog.discourse.group/t/problem-inserting-keys-in-association-list/1055/1 "2019-08-11T10:20:40Z")

</div>

I have the following code: (get\_assoc(Line, Assoc, Value) -\> Value1 is Value+1; Value1 is 1), put\_assoc(Line, Assoc, Value1, Array). When I try to add the key: 3581 with value 1 and the key 2619 with value 1 the first pair is successfull while the second fails. I am providing a screenshot of the trace failure.

 ![problem](https://global.discourse-cdn.com/free1/uploads/swiprolog/original/1X/dd8e77a18a8ab5f0b454029aaa082481bafcf287.jpeg)
