fixed issue with pagination