fixes potential bug in texpr method