Move module import to be a function-scope import to avoid the import error while osis restart