Fixed logic to only read pickled files