the jquery add fct was behaving erratically. fixed it with array. i think i shd remove jquery dependency.