fixing server and main communication