connects to remote database