fix plan finish bug