edit, destroyed function added