Fix crashing because of item per page