Changed write mode from w+ to a