add basic error checking to pretty_table()