update pagination js fucntions