sapply returns a list instead of a 0-length vector when input is 0-length
delete recursively