fix to open(x ,'w') so file will be created