use array delete instead of simple delete