Bug in legend api