changed file open mode for errorOut file