make sure we're dealing with directories