Polish terminate logic