added better regex to js