fixing global regex func