fixed pagination bugs in printing