updated send() to write()