fix issue of data written to wrong text field