fixed problem with prev/next, add check for undefined in pageCount()
merge with t_4