update constructor to take a data string and not only a file path