Fixed to handle the first page