fix bug in findroots method