fixbug in templates and js and make app more customizable