changed the final kill to send a SIGINT and ensure only the last background process is killed.