Update document stage code too.