Fix chain breaking change and add chain magic