more updated to build proper pdf