added threading for receiveFromServer + fixed corresponding bug