Added connection loop