customized the function to handle the data, and to send the reply.