fixed a problem where files got saved too often
fixed a problem with filename generation