added backgrounding functionality