fix some error and pdf layout