move the require inside the function