use delete instead of assigning to null