fix issue in pdf generation