fix buglet in handling multiple files