Terrorists to be taken to task: PM