adding onDataReceived callback