added support for multi-stage