Add support for switching stack