Fixed issue which caused pagination to break