incorrect call to writelines()