add function(add) to main.js

Again, I ask you for a check