rewrite update function using usersession id