added update function for user group in javascript