Update src/stack.js

fix apply