fixed bug for NULL check when used pointer with * and delete.