improve the send and get function