add new terminal detection method