I found out how to fix it, not what causes it really.
it is fixed by adding
event.stopPropagation();
and
event.preventDefault();
It was triggered by some sort of propagation to the add button for some reason