Need to modify pagination on member's page to show results from WP role

I have edited the BP member's loop to show only a certain WP role based on the following code that was found elsewhere:

<ul id="members-list" class="item-list">
<?php while ( bp_members() ) : bp_the_member();
	$user = new WP_User( bp_get_member_user_id() );
	if ( $user->roles[0] == 'somerole' ) :
?>

<li>member content here</li>
<?php endif; ?>
<?php endwhile; ?>
</ul>

Now that I have limited what is shown in the members loop, the pagination is still showing the total amount of members, and not just the members I actually want. Does anyone have any idea on how to fix the pagination to just show the total amount of users from the selected role? Thanks