fix delete operation, delete for the whole array not just the pointer