splice calls were emptying whenLiveElements

added length parameter to splice calls, to make sure they only remove one item at a time.