fix issues with math element