Updated chaining logic