fix for math pdf bug