fix square brackets bug