Add file handler and write