fixed legend interfering with other variables