Add listener and edit template