moved import to inner function to avoid import guard issue