handle invalid text formats