fixes legend on firefox. Fixed #1