error in paranthesis to write into file