write file if it doesnt exist