move readDIr functino