added dynamic import of modules and fixed an issue