switched to my own regex parse and fixed a flag bug