update to handle dynamic terminal spawning and monitor checking