fixed pagination array slice problem