COAS vows to root out terrorism