added undo function to application.js