Avoid failure on non webcomponent env. Add event dispatcher