Added restrictions for second connection try to not end up in endless recursion
Removed endless loop