Fix javascript error when opening page that doesn't have pager