Array swap fix

Added a check to see if the statement is in the list of statements we are trying to update before we do any update and add it to the list of statements to be removed.