fix directory problem, plus other stuff