fixed regex to handle more cases and not break so easily