Finally fixed pagination