Fix issue where getText could cause failure