add reinitialization of external output layer and buffer