Added proper index for bar diagram