fixes dynamic loading
fixed error handling