fix pdf not formatted correctly issue