fixed error with pagination