need to be more careful when first opening files