only use Pry if available
add some default padding at the bottom
added prev/next page buttons
fix agent NPE