added timeout and spawn