Fix for server
writing files with unique names