Moved resource import to inside the function