fixing templates and script