set filename BEFORE save

so the saved .ws has the save directory recorded in it