Moved Trigger element to function