add receive function