Added memory deletion