ensure objects are deleted to stop memory leak