update receive function