updated to check peer number