modified class to receive data from the background service