changed file to append mode