Add isMain flag for listener.