Update function update_score