bug fix in RM_Close, RM_InsertRec, RM_FileScan, implement file scan condition