added function to reset chains