fixes issue with legend on mobile