diff --git bp-templates/bp-legacy/js/buddypress.js bp-templates/bp-legacy/js/buddypress.js
index c81ae20..a04f665 100644
--- bp-templates/bp-legacy/js/buddypress.js
+++ bp-templates/bp-legacy/js/buddypress.js
@@ -903,7 +903,7 @@ jq(document).ready( function() {
 	/* Select a user from the list of friends and add them to the invite list */
 	jq("#send-invite-form").on( 'click', '#invite-list input', function() {
 		// New template contains a div with the class of invite that's a first-level child of the form. Old template doesn't.
-		var invites_new_template = jq("#send-invite-form > invite").length;
+		var invites_new_template = jq("#send-invite-form > .invite").length;
 
 		jq('.ajax-loader').toggle();
 
@@ -954,7 +954,7 @@ jq(document).ready( function() {
 	/* Remove a user from the list of users to invite to a group */
 	jq("#send-invite-form").on('click', 'a.remove', function() {
 		// New template contains a div with the class of invite that's a first-level child of the form. Old template doesn't.
-		var invites_new_template = jq("#send-invite-form > invite").length;
+		var invites_new_template = jq("#send-invite-form > .invite").length;
 
 		jq('.ajax-loader').toggle();
 
