Added foreground loop, foreground tasks and stopping tasks (crl+z then kill -9) runs properly.  Still need to do background tasks