fix iteration in pinning