corrected for recent mesa versions