modified to receive data from the background process