fixed LaTeX bug and update timer loop bug