fix ykalchevskiy issue about l.remove(i)