fixed pagination bug with page = 0