not using basename, in case there are nested dirs