Fixed syntax error causing pagination failure