should this by .splice(idx,1) ?