ensured graceful exit from check.js; added a process kill timeout