Revert 301, fix issue in legend template

#301 revert