Fix pages dependency
Bugfix with sorting