fixed each and template edit