edit template works properly