added 'expect eof' after spawning the process