Fix regex, close on click outside card, some comments