corrected opendir, releasedir, and readdir