Accessing index in addColumn method to prevent errors