cleaner delete, test for pointer and set it to NULL