fixing icorrect behavior when pitting files