changed DataHandler file to write to a file directly