changed open log w+ to a+