my guess is that you may just have to move this import inside the function