Add dynamic importing and exception handling