trying to open and write to file