added backgrounding support