now also works for single directories