Added a parseInt fix since it was breaking on assigning a data-id=num+1 value since num was not an integer