Bug fixing for pagination error