Problems when connecting to server