better js pagination