Fix for broken pagination