moved url checking to a function - call checkUrl imediately after hearing from a new peer