windows is working
fixed unix version (now returns folder too)