close templates added to global js