added/fixed regex here instead of in js