added connection to the public function openConnection(). video 29