made regex better in script