added stack support