Bug fix for custom element