cleanup entity scripts when changing domains or entity is deleted