add some simple function to deal with chain id extraction
merge conflicts