added event handler to automatically update user's group on the view