fix missing write mode in file handler