updated binary writing from server
updated binary writing