exists to isdir, thanks Niphlod