something is definetely wrong... when writing to file