fixed a possibly fatal directory error. Reintroduced menu but still not stable (or very usable) for now.