Fixed the next and previous bug when dom regenarate