fixed recursive directory creation and path problems