fixed bug in writing initial file for ws3dinv