adapted freeling for client-server mode