implented edit button in TEMPLATE