Improve error gestion and add support for promise for loading plugins