working version, without directory browser