Fix for pagination setting currentPage to undefined