Fixed syntax error. Improved logic for triggering element.