Fixed empty list error. Now checking for empty newStates if any