some bugfixes, file-reading not working anymore
fixed wrong dir handle allocation