fix bug with edit template