fixed write socket arguments