added blocks to foreground processes
moved polling to before prompt