use writeObject instead of writeUTF