got rid of using expect and spawn.