Add prolog trigger thread.
Clean up.