fix bugs for unformatted stock files