fix #2. set text_factory to 'str' when connect to database