Added support for multiple chains