Timely action by security agencies foiled several major terrorist plots