fix issue #195 in pdfkit repo

this is my first time using github and its pull requests model :) please don't kill me if i break something :)
i tested the fix to work correctly to my best extent