refactored tutorial.js and prevent the problem with the function in rails admin