Fixed error in reading text fields