updated pagination to use root variable in its path