added more ajax and a regex to capture bad input