now reading and rewriting all the files in specified folder