fixing file name generation in stream