Fixed error in connecting with remote server.