FINALLY fixed pagination