Cardinals escape nail-biter