Fix writeable and send function