Changed send function, not tested now