fix bug of recursive extend