fixed an issue with removing targets while an object is being deallocated