fix page ordering query in production