fix parsing of math