implement function for user update.