Added text format and catch print exception