fixes columns when perpage is set to 0

added more comments, fixes column when perpage is set to 0