Fixed bug with determining chain