changing function origanizations for send_wrapper and receive_wrapper in terms of placing callbacks