update the update function for parallel version