implemented $connect