trim the extra files