Added callback function for receiveing packet event.