fixed file writing, converted Calendar to Date
update