added delete instance function