Avoid carrying var late into the .slice() closure