fixed bug in template if statement (one char fix -_-)
added next/prev page links, fixed 500 error