Complete receive function