change new processOutput() code so that it runs in bg thread so that it doesn't block